package ${cfg.responsePackage};

import java.io.Serializable;
import java.util.Date;
import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import ${cfg.enumPackage}.${entity}Enums;
<#if swagger2>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
</#if>
<#if entityLombokModel>
import lombok.Data;
import lombok.EqualsAndHashCode;
    <#if chainModel>
import lombok.experimental.Accessors;
    </#if>
</#if>

/**
 * <p>
 * ${table.comment!}
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
<#if entityLombokModel>
@Data
    <#if superEntityClass??>
@EqualsAndHashCode(callSuper = true)
    <#else>
@EqualsAndHashCode(callSuper = false)
    </#if>
    <#if chainModel>
@Accessors(chain = true)
    </#if>
</#if>
<#if swagger2>
@ApiModel(value="${entity}ResponseDto对象", description="${table.comment!}响应对象")
</#if>
public class ${entity}ResponseDto implements Serializable {

<#if entitySerialVersionUID>
    private static final long serialVersionUID = 1L;
</#if>
<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list table.fields as field>
    <#if field.keyFlag>
        <#assign keyPropertyName="${field.propertyName}"/>
    </#if>

    <#if field.comment!?length gt 0>
        <#if swagger2>
    @ApiModelProperty(value = "${field.comment}")
        <#else>
    /**
     * ${field.comment}
     */
        </#if>
    </#if>
    <#if field.propertyType=="Long">
    @JsonSerialize(using= ToStringSerializer.class)
    </#if>
    <#if field.propertyType="Date">
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    </#if>
    private ${field.propertyType} ${field.propertyName};

    <#if field.propertyType=="Integer" && cfg.genUtil.isDescField(field.comment)>
    @ApiModelProperty(value = "${cfg.genUtil.getShortComment(field.comment)!''}")
    private String ${cfg.genUtil.getDescField(field.propertyName,field.comment)};
    </#if>
</#list>
<#------------  END 字段循环遍历  ---------->
<#list table.fields as field>
    <#if field.propertyType=="Integer" && cfg.genUtil.isDescField(field.comment)>
        ${cfg.genUtil.getDescFieldMethod(entity,field.propertyName)}
    </#if>
</#list>
}
